import { createClient } from "@supabase/supabase-js";

const { SUPABASE_URL, SUPABASE_KEY } = process.env;

export const supabase = createClient(SUPABASE_URL, SUPABASE_KEY);

export function getSbData(res, errMsg) {
  if (res.error) {
    throw errMsg || res.error;
  }
  return res.data;
}

export const supaTabs = {
  DeliverLog: "deliver_log",
  SysLog: "sys_log",
};
